package com.ruoyi.project.business.fenlei.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.business.fenlei.mapper.FenleiMapper;
import com.ruoyi.project.business.fenlei.domain.Fenlei;
import com.ruoyi.project.business.fenlei.service.IFenleiService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-09
 */
@Service
public class FenleiServiceImpl implements IFenleiService 
{
    @Autowired
    private FenleiMapper fenleiMapper;

    /**
     * 查询分类
     * 
     * @param id 分类主键
     * @return 分类
     */
    @Override
    public Fenlei selectFenleiById(Integer id)
    {
        return fenleiMapper.selectFenleiById(id);
    }

    /**
     * 查询分类列表
     * 
     * @param fenlei 分类
     * @return 分类
     */
    @Override
    public List<Fenlei> selectFenleiList(Fenlei fenlei)
    {
        return fenleiMapper.selectFenleiList(fenlei);
    }

    /**
     * 新增分类
     * 
     * @param fenlei 分类
     * @return 结果
     */
    @Override
    public int insertFenlei(Fenlei fenlei)
    {
        return fenleiMapper.insertFenlei(fenlei);
    }

    /**
     * 修改分类
     * 
     * @param fenlei 分类
     * @return 结果
     */
    @Override
    public int updateFenlei(Fenlei fenlei)
    {
        return fenleiMapper.updateFenlei(fenlei);
    }

    /**
     * 批量删除分类
     * 
     * @param ids 需要删除的分类主键
     * @return 结果
     */
    @Override
    public int deleteFenleiByIds(String ids)
    {
        return fenleiMapper.deleteFenleiByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除分类信息
     * 
     * @param id 分类主键
     * @return 结果
     */
    @Override
    public int deleteFenleiById(Integer id)
    {
        return fenleiMapper.deleteFenleiById(id);
    }
}
